  //获取元素的内部样式obj中name样式的值
      function getStyle(obj,name){
     if(obj.currentStyle){
	    return obj.currentStyle[name];
	    }else{
	    return getComputedStyle(obj,false)[name];
	  }
     }
       // var alpha=30;
	   //完美运动框架
	   //startMove(oDiv,{width:400,height:400})
	   //function startMove(obj,attr,iTarget,fnEnd)
	   function startMove(obj,json,fnEnd){
	     clearInterval(obj.timer);
		 obj.timer=setInterval(function(){
		    var bStop=true; //假设：所有属性值都到了	 
		   //获取json中属性{width:200}
		   for(var attr in json){
		   var cur=0;
			//判断当前属性
			if(attr=='opacity'){
			   cur=Math.round(parseFloat(getStyle(obj,attr))*100);
			}else{
			   cur=parseInt(getStyle(obj,attr));
			}		 
		    //cur=parseInt(getStyle(obj,attr));
		    //计算属性运动的速度
			var speed=(json[attr]-cur)/6;
			speed=speed>0?Math.ceil(speed):Math.floor(speed);
			if(cur!=json[attr])
			    bStop=false;			
			//判断属性值是否达到目标点
			/*if(json[attr]==cur){
			   clearInterval(obj.timer);
			   //在当前运动结束之后被调用
			   if(fnEnd)fnEnd();			   
			}else{*/
			  if(attr=='opacity'){
			    obj.style.filter='alpha(opacity:'+(cur+speed)+')';
				obj.style.opacity=(cur+speed)/100;		  			  			 
			  }else{
			   obj.style[attr]=cur+speed+"px";
			  }			   
			//}
		   }
		   if(bStop){
			   clearInterval(obj.timer);
			   if(fnEnd)fnEnd();
		   }
		 },30);		 		 
	   }
	   
	   
	   //共享onload事件
	    function addLoadEvent(func){
			var oldonload=window.onload;
			if(typeof window.onload!='function'){
				window.onload=func;
			}else{
				window.onload=function(){
					oldonload();
					func();
				}
			}
			
		}